package com.dudu.service.impl;


import com.dudu.dao.AssetsMapper;
import com.dudu.dao.AssettypeMapper;
import com.dudu.dao.RoomAssetMapper;
import com.dudu.dao.RoomMapper;
import com.dudu.dao.RoomtypeMapper;
import com.dudu.dao.SmallassetstypeMapper;
import com.dudu.domain.Assets;
import com.dudu.domain.Assettype;
import com.dudu.domain.Room;
import com.dudu.domain.Roomtype;
import com.dudu.domain.Smallassetstype;
import com.dudu.service.AssetsService;
import com.dudu.service.RoomService;
import com.dudu.service.RoomTypeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * Created by tengj on 2017/4/7.
 */
@Service
public class AssetsServiceImpl implements AssetsService {
    @Autowired
    AssetsMapper assetsMapper;
    @Autowired
    RoomAssetMapper roomAssetMapper;
    @Autowired
    SmallassetstypeMapper smallassetstypeMapper;
    @Autowired
    AssettypeMapper assettypeMapper;
    
	@Override
	public List<Assets> getAllAssets() {
		// TODO Auto-generated method stub
		return assetsMapper.getAllAssets();
	}

	@Override
	public List<Assets> getAssetsbyRoomId(Integer id) {
		// TODO Auto-generated method stub
		return roomAssetMapper.selectAssetbyRoomId(id);
	}

	@Override
	public List<Smallassetstype> getAllSmallassetstype() {
		// TODO Auto-generated method stub
		return smallassetstypeMapper.getAllSmallassetstype();
	}

	@Override
	public List<Assettype> getAllAssettype() {
		// TODO Auto-generated method stub
		return assettypeMapper.getAllAssetType();
	}

	@Override
	public int deletAssets(String  id) {
		// TODO Auto-generated method stub
		return assetsMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int addAssets(Assets assets) {
		// TODO Auto-generated method stub
		return assetsMapper.insert(assets);
	}

	@Override
	public int updatAssets(Assets assets) {
		// TODO Auto-generated method stub
		return assetsMapper.updateByPrimaryKey(assets);
	}

	@Override
	public Assets selectAssetsById(String  id) {
		// TODO Auto-generated method stub
		return assetsMapper.selectByPrimaryKey(id);
	}

}
